import unittest
from unittest import TestCase
from ddt import ddt,data,unpack

# 案例：单个数据
@ddt
class Test1(unittest.TestCase):
    @data('111','122','133','144')
    def test1(self,value):
        print('打印value的值:'+value)
        self.assertIn('1',value)

# 案例：组合数据，未拆分
@ddt
class Test2(unittest.TestCase):
    @data(['aaa','abb','acc'],['add','aee','aff'])
    def test2(self,value):
        print(value)

# 案例：组合数据，拆分（重点掌握
@ddt
class Test3(unittest.TestCase):
    @data(['aaa','abb','acc'],['add','aee','aff'])
    @unpack
    def test3(self,value1,value2,value3):
        print(value1,value2,value3)

if __name__ == '__main__':
    unittest.main()